﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using DLV.Library.Utilities;
using System.Globalization;

namespace DLV.Data.Entities
{
    public class StayInfo
    {
        #region private fields

        private int _stayId = Null.NullInteger;
        private int _priceId = Null.NullInteger;
        private DateTime _onDate = Null.NullDate;
        private DateTime _offDate = Null.NullDate;
        private int _roomQuantity = Null.NullInteger;
        private decimal _totalPrice = Null.NullDecimal;
        private int _createdBy = Null.NullInteger;
        private DateTime _createdDate = Null.NullDate;
        private int _updatedBy = Null.NullInteger;
        private DateTime _updatedDate = Null.NullDate;
        private int _status = Null.NullInteger;
        private int _scheduleId = Null.NullInteger;


        #endregion
        #region public properties
        public int StayId
        {
            get { return _stayId; }
            set { _stayId = value; }
        }
        public int PriceId
        {
            get { return _priceId; }
            set { _priceId = value; }
        }
        public DateTime OnDate
        {
            get { return _onDate; }
            set { _onDate = value; }
        }
        public DateTime OffDate
        {
            get { return _offDate; }
            set { _offDate = value; }
        }
        public int RoomQuantity
        {
            get { return _roomQuantity; }
            set { _roomQuantity = value; }
        }
        public decimal TotalPrice
        {
            get { return _totalPrice; }
            set { _totalPrice = value; }
        }
        public int CreatedBy
        {
            get { return _createdBy; }
            set { _createdBy = value; }
        }
        public DateTime CreatedDate
        {
            get { return _createdDate; }
            set { _createdDate = value; }
        }
        public int UpdatedBy
        {
            get { return _updatedBy; }
            set { _updatedBy = value; }
        }
        public DateTime UpdatedDate
        {
            get { return _updatedDate; }
            set { _updatedDate = value; }
        }
        public int Status
        {
            get { return _status; }
            set { _status = value; }
        }

        public int ScheduleId
        {
            get { return _scheduleId; }
            set{_scheduleId = value;}
        }

        #endregion
        #region Custom

        public string HotelFullName { get; set; }
        public string RoomName { get; set; }
        public string AgeName { get; set; }
        public string NationalName { get; set; }
        public int SalePrice { get; set; }
        public int AgeId { get; set; }
        public string RoomTypeName { get; set; }
        public int Night {
            get {
                var night = OffDate - OnDate;
                return night.Days;
            }
        }
        public string StayName
        {
            get
            {
                var stayName =  HotelFullName;
                if (!String.IsNullOrEmpty(RoomName))
                    stayName += " - " + RoomName;
                if (!String.IsNullOrEmpty(AgeName))
                    stayName += " - " + AgeName;
                if (!String.IsNullOrEmpty(NationalName))
                    stayName += " - " + NationalName;
                stayName += " - " + SalePrice.ToString("#,###", new CultureInfo("vi-VN")) + " VND";
                return stayName;
            }
        }
        #endregion
    }
   

}
